<?php
  $user=$_POST['user'];
  $pw=$_POST['pw'];
  require('sql.php');
  $result = mysqli_query($conn,"SELECT * FROM yonghu WHERE id='$user'");
  $num=mysqli_num_rows($result);
    if($num)//判断结果集非空
    {
    	$row = mysqli_fetch_array($result);
    	$mima= $row['mima'];
    	if($pw!=$mima)
    	{
    		echo "密码输入有误";
    	}
    	else
    	{
    		echo 1;
    	}
    }
    else
    {
    	echo "用户名不存在";
    }
?>